#!/bin/sh
# Begin $rc_base/init.d/mpd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org
# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
# Stores mixer settings in the default location: /etc/asound.state

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
	start)
		boot_mesg "Starting MPD..."
		chown -R root.nobody /var/ipfire/mpfire/db
		/bin/nice --5 /usr/bin/mpd
    evaluate_retval
		;;
	stop)
		boot_mesg "Stopping MPD..."
		/usr/bin/mpd --kill
    evaluate_retval
		;;
	status)
		statusproc /usr/bin/mpd
		;;
	restart)
		$0 stop
		sleep 3
		$0 start
		;;
	*)
		echo "Usage: $0 (start|stop|restart|status)"
		exit 1
		;;
esac

# End $rc_base/init.d/alsa
